#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#define s(i) scanf("%d", &i)
#define sl(i) scanf("%lld", &i)
#define SET(v, i) memset(v, i, sizeof(v))
#define DIM 2
#define MAXN 505
#define MAXM 100005
#define MOD 1000000007
using namespace std;
typedef long long ll;

struct matrix{
    ll a[DIM][DIM];

    matrix(){
        SET(a, 0);
    }

    void unit_matrix(){
        a[0][0] = 26; a[0][1] = 52;
        a[1][0] = 0; a[1][1] = 1;
    }

    matrix operator* (matrix b){
        matrix c;
        for (int k=0;k<DIM;k++)
        for (int i=0;i<DIM;i++)
        for (int j=0;j<DIM;j++)
            c.a[i][j] = (c.a[i][j] + a[i][k] * b.a[k][j]) % MOD;
        return c;
    }
};

matrix pow_matrix(matrix a, ll n){
    if (n == 1) return a;
    matrix b = pow_matrix(a, n / 2);
    b = b * b;
    if (n & 1) b = b*a;
    return b;
}

int t;
ll n;
matrix a;

int main()
{
    freopen("TAPALIN.txt","r", stdin);
    s(t);
    while (t--){
        sl(n);
        if (n <= 2){
            cout << 26*n << endl;
            continue;
        }
        a.unit_matrix();
        a = pow_matrix(a, (n+1)/2);
        ll ans = a.a[0][1];
        if (n & 1) ans = (ans - a.a[0][0] + MOD)%MOD;
        cout << ans << endl;
    }
    return 0;
}
